package com.zsrt.java.day20161229.wrl.demo05;

/**
 * 创建类 Car
 * 品牌 String brand
 * 价格 double price
 * @author Administrator
 *
 */
public class Car {
	
	public Car() {
		System.out.println("调用无参构造方法...");
	}

	public Car(String brand, double price) {
		System.out.println("调用有参构造方法...");
		this.brand = brand;
		this.price = price;
	}
	
	private String brand;
	private double price;
	
	public void setBrand(String brand){
		this.brand = brand;
	}
	public String getBrand(){
		return brand;
	}
	
	public void setPrice(double price){
		this.price = price;
	}
	public double getPrice(){
		return price;
	}
	
	@Override
	public String toString() {
		return "Car [brand=" + brand + ", price=" + price + "]";
	}
	public static void main(String[] args) {
		Car byd = new Car();
		byd.setBrand("法拉利");
		byd.setPrice(8000000.1);
		System.out.println("品牌："+byd.getBrand());
		System.out.println("价格："+byd.getPrice());
	}
	
}
